home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
CC_C
/
0574.ZIP
/
STRCAT.ASM
< prev
next >
Wrap
Assembly Source File
|
1986-11-21
|
586b
|
48 lines
include compiler.inc
ttl STRCAT, 1.04, 08-30-86, clr
;string function - catenates 2nd string on end of 1st
; - catenates 2nd string on end of 1st with max characters
dseg
cseg
procdef strncat, <<dest, ptr>, <src, ptr>, <cnt, word>>
mov cx,cnt
jmp short start
entrdef strcat
mov cx,7fffh
start:
pushreg
pushds
push cx
ldptr di,dest
xor al,al
mov cx,7fffh
cld
repnz scasb
dec di
ldptr si,src
pop cx
lp:
lodsb
stosb
or al,al
jz ex
loop lp
xor al,al
stosb
;
ex:
clc
retptrm dest
pend strncat
finish